package com.xtkj.superclub_user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xtkj.superclub_entity.entity.user.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

/**
 * @author lizheqi
 * @create 2019-12-23-20:09
 */
@Mapper
@Component
public interface IUserDao extends BaseMapper<User> {

    @Select("select * from c_user where telephone = #{telephone}")
    @ResultType(User.class)
    User checkLogin(User user);

    @Insert("insert into c_user values(#{userId},#{personalAlbumId},#{nickName},#{sex},#{telephone},#{password},0,#{headPortrait},#{age},#{personalizedSignature},#{hobby},#{post},#{hometown},#{city},#{integral},now(),now())")
    void userRegister(User user);

    @Update("update c_user set personal_album_id=#{personalAlbumId}, nick_name =#{nickName},sex=#{sex},head_portrait=#{headPortrait},age=#{age},personalized_signature=#{personalizedSignature},hobby=#{hobby},hometown=#{hometown},city=#{city} where user_id =#{userId}")
    void updateUser(User user);
}
